import { invoke } from '@tauri-apps/api/core';
const WindowIcon = () => {
    const handleCloseWindow = async () => {  
        try {  
          await invoke('close_window');  
        } catch (error) {  
          console.error('Error closing window:', error);  
        }  
      };  
    
      const handleMinimizeWindow = async () => {  
        try {  
          await invoke('minimize_window');  
        } catch (error) {  
          console.error('Error minimizing window:', error);  
        }  
      };  
    
      const handleMaximizeWindow = async () => {  
        try {  
          await invoke('maximize_window');  
        } catch (error) {  
          console.error('Error maximizing window:', error);  
        }  
      };  
    
    //   const handleToggleMinimize = async () => {  
    //     try {  
    //       await invoke('toggle_minimize');  
    //     } catch (error) {  
    //       console.error('Error toggling minimize:', error);  
    //     }  
    //   };  
    return (
        <div id="window_icon">
            <span className="iconfont icon-2zuixiaohua-2" onClick={handleMinimizeWindow}></span>
            <span className="iconfont icon-quanpingzuidahua" onClick={handleMaximizeWindow}></span>
            <span className="iconfont icon-guanbi" id="btn_close" onClick={handleCloseWindow}></span>
        </div>
    )
}
export default WindowIcon
